package com.yegs.jltqc.dao;

import com.yegs.jltqc.VO.Project;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ProjectRepository extends JpaRepository<Project,Long> {

    Page<Project> findProjectsByNameLike(String name, Pageable pageable);

    Page<Project> findProjectByCinvcodeLike(String cinvcode, Pageable pageable);

    Page<Project> findProjectByCinvcodeLikeAndNameLike(String cinvcode, String name, Pageable pageable);


    List<Project> findProjectByCinvcode(String cinvcode);

    Project findProjectByCinvcodeAndVersion(String cinvcode,String version);

    Project findFirstByIdIsAfter(Long id);

    Project findFirstByIdBeforeOrderByIdDesc(Long id);

    Project findFirstByOrderById();

    Project findFirstByOrderByIdDesc();

}
